set host_name="%1"

if %host_name%=="" exit

for /f "delims=" %%a in ('cd') do set cur_dir=%%a

set pgmdir1="C:\Program Files\ICW\"

set sshbin1="C:\Program Files\ICW\Bin\ssh.exe"

set pgmdir2="C:\Program Files (x86)\ICW\"

set sshbin2="C:\Program Files (x86)\ICW\Bin\ssh.exe"

if exist %sshbin1% cd %pgmdir1%
if exist %sshbin2% cd %pgmdir2%

set rsa_cert="home\supersea\.ssh\id_rsa"
set halt_cmd="/cygdrive/c/WINDOWS/system32/shutdown.exe /s /t 0 /f"

Bin\ssh.exe supersea@%host_name% -i %rsa_cert% %halt_cmd%

cd %cur_dir%
